﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TextEditorI.Models
{
    public class DocumentModel : ObservableObject
    {
        /// <summary>
        /// Text Editor 文字部分：->_text/Text
        /// </summary>
        private string _text;
        public string Text
        {
            get
            { return _text; }
            set
            { OnPropertyChanged(ref _text, value); }
        }
        /// <summary>
        /// 文件名称
        /// </summary>
        private string _fileName;
        public string FileName
        {
            get
            { return _fileName; }
            set
            { OnPropertyChanged(ref _fileName, value); }
        }
        /// <summary>
        /// 文件存储路径
        /// </summary>
        private string _filePath;
        public string FilePath
        {
            get
            { return _filePath; }
            set
            { OnPropertyChanged(ref _filePath, value); }
        }
        /// <summary>
        /// 当前文件是否为新项目
        /// </summary>
        public bool isEmpty
        {
            get
            {
                if (string.IsNullOrEmpty(FilePath) || string.IsNullOrEmpty(FileName))
                {
                    return true;
                }
                else return false;
            }
        }
    }
}
